package com.whli.autumn.mall.web.controller.wms;

import com.github.pagehelper.PageInfo;
import com.whli.autumn.core.app.annotation.ApiVersion;
import com.whli.autumn.core.extend.controller.BaseController;
import com.whli.autumn.core.permission.annotation.RequirePermissions;
import com.whli.autumn.core.share.ResponseResult;
import com.whli.autumn.mall.wms.domain.dto.stocklog.StockLogPageDTO;
import com.whli.autumn.mall.wms.domain.entity.StockLog;
import com.whli.autumn.mall.wms.service.IStockLogService;
import com.whli.autumn.mall.wms.domain.vo.stocklog.StockLogVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>库存日志API</p>
 *
 * @author whli
 * @version 1.0.0
 * @since 2023-05-01 10:26
 */
@Api(tags = "仓库管理-库存日志")
@ApiVersion
@RestController
@RequestMapping(value = "/wms/stockLog")
public class StockLogController extends BaseController<StockLog, IStockLogService> {

    /**
     * <p>分页查询库存日志</p>
     *
     * @author  whli
     * @since   2023-05-01 10:26
     * @param   entity 分页参数
     * @return
     */
    @ApiOperation(value = "分页查询库存日志", httpMethod = "GET")
    @RequirePermissions("wms:stock-log:list")
    @GetMapping("page")
    public ResponseResult<PageInfo<StockLogVO>> listByPage(StockLogPageDTO entity) {
        PageInfo<StockLogVO> page = service.listByPage(entity);
        return ResponseResult.success(page);
    }

}
